import 'package:equatable/equatable.dart';
import 'package:json_annotation/json_annotation.dart';

import 'attribute_option_requset_params.dart';
import 'specification_name_request_params.dart';

part 'specification_add_request_params.g.dart';

@JsonSerializable(explicitToJson: true)
class SpecificationAddRequestParams extends Equatable {
  factory SpecificationAddRequestParams.fromJson(Map<String, dynamic> json) =>
      _$SpecificationAddRequestParamsFromJson(json);

  Map<String, dynamic> toJson() => _$SpecificationAddRequestParamsToJson(this);

  @override
  List<Object> get props =>
      [attributeOptions, orderValue, specificationNames, specId, specName];

  final List<AttributeOptionRequestParams> attributeOptions;

  final String orderValue;

  final List<SpecificationName> specificationNames;

  final String specId;

  final String specName;

  SpecificationAddRequestParams({
    this.attributeOptions,
    this.orderValue,
    this.specificationNames,
    this.specId,
    this.specName,
  });

  SpecificationAddRequestParams copyWith({
    List<AttributeOptionRequestParams> attributeOptions,
    String orderValue,
    List<SpecificationName> specificationNames,
    String specId,
    String specName,
  }) {
    return SpecificationAddRequestParams(
      attributeOptions: attributeOptions ?? this.attributeOptions,
      orderValue: orderValue ?? this.orderValue,
      specificationNames: specificationNames ?? this.specificationNames,
      specId: specId ?? this.specId,
      specName: specName ?? this.specName,
    );
  }
}
